package com.biz.ssm.mapper;

import com.biz.ssm.base.BaseMapper;
import com.biz.ssm.domain.RoleAuthority;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;


/**
 * RoleAuthorityMapper数据库操作接口类
 **/
@Mapper
public interface RoleAuthorityMapper extends BaseMapper<RoleAuthority, Long> {
    /**
     * 根据角色查询权限
     *
     * @param roleId
     * @return
     */
    List<String> getAuthoritysByRole(@Param("roleId") Long roleId);

    /**
     * 移除权限
     *
     * @param roleId
     * @param authorities
     */
    void deleteAuthority(@Param("roleId") Long roleId, @Param("authorities") String authorities);

    /**
     * 新增权限
     *
     * @param roleAuthority
     */
    void saveAuthority(@Param("roleAuthority") RoleAuthority roleAuthority);

    /**
     * 删除RoleAuthority
     *
     * @param roleId
     * @return
     */
    void delByRole(@Param("roleId") Long roleId);
}
